package com.ewhale.feitengguest.presenter.user.mine;

import com.ewhale.feitengguest.api.ApiHelper;
import com.ewhale.feitengguest.view.user.mine.FeelBackView;
import com.simga.library.base.IPresenter;
import com.simga.library.http.APIException;

public class FeelBackPresenter extends IPresenter {
    public void commitContent(String content) {
        request(1, ApiHelper.USER_API.commitFeedBack(content),null);
    }

    @Override
    public <T> void onNext(int postCode, T result, Object data) {
        super.onNext(postCode, result, data);
        switch (postCode){
            case 1:
                ((FeelBackView)mView).commitSuccess();
                break;
        }
    }

    @Override
    public void otherException(int postCode, Object data, APIException e) {
        super.otherException(postCode, data, e);
        mView.showErrorMessage(postCode,e.getCode(),e.getDisplayMessage());
    }
}
